package practice16;

public class Main {
    public static int solution(int[] inp) {
        int uniqueNumber = 0;
        for (int num : inp) {
            uniqueNumber ^= num; // XOR operation
        }
        return uniqueNumber;
    }

    public static void main(String[] args) {
        // Test cases
        System.out.println(solution(new int[]{1, 1, 2, 2, 3, 3, 4, 5, 5}) == 4); // true
        System.out.println(solution(new int[]{0, 1, 0, 1, 2}) == 2); // true
        System.out.println(solution(new int[]{7, 3, 3, 7, 10}) == 10); // true
    }
}